<?php

session_start();

@$isok=$_SESSION["islogin"];


if(!$isok){
    header("Refresh:3;url=diancanxitong.php");
    exit("请先登录！");
}





    $pdo=new PDO("mysql:dbname=caipin;host=127.0.0.1;charset=UTF8","root","root");
    $sql3=$pdo->prepare("select * from caixi;");
    $sql3->execute();
    $arrl=$sql3->fetchAll(PDO::FETCH_NAMED);

?>


<html>
<head>
   <meta charset="UTF-8">
    <title>Title</title>
    <link type="text/css" rel="stylesheet" href="css/bootstrap.css">
    <link type="text/css" rel="stylesheet" href="css/bootstrap-theme.css">
    <script src="js/jQuery文件.js"></script>
    <script src="js/bootstrap.js"></script>
</head>
<body>
<!--导航条-->
<nav class="navbar navbar-default">
    <div class="container-fluid" >
        <div class="navbar-header" >

                        <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                            <span class="sr-only">Toggle navigation</span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                        </button>
                        <a class="navbar-brand" href="zhuohao.php" style="margin: 0 0 0 80px;font-size: 30px ">点餐系统</a>
                    </div>


                    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                        <ul class="nav navbar-nav">
                            <li class="dropdown">
                                <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">订餐管理 <span class="caret"></span></a>
                                <ul class="dropdown-menu">
                                    <li><a href="dindanliebiao.php">订单列表</a></li>
                                    <li><a href="dindanjilu.php">订单记录</a></li>       
                                </ul>
                            </li>
                            <li class="dropdown">
                                <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">菜品管理<span class="caret"></span></a>
                                <ul class="dropdown-menu">
                                    <li><a href="caitianjia.php">添加菜品</a></li>
                                    <li><a href="cailiebiao.php">菜品列表</a></li>                             
                                    <li role="separator" class="divider"></li>
                                    <li><a href="cailiexing.php">添加菜品类型</a></li>                                
                                    <li><a href="cailiexingliebiao.php">菜品类型列表</a></li>
                                </ul>
                            </li>
                            <li class="dropdown">
                                <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">餐桌管理 <span class="caret"></span></a>
                                <ul class="dropdown-menu">
                                    <li><a href="tianjia.php">添加餐桌</a></li>
                                    <li><a href="liebiao.php">餐桌列表</a></li>                                  
                                </ul>
                            </li>
                            <li class="dropdown">
                                <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">登录管理 <span class="caret"></span></a>
                                <ul class="dropdown-menu">
                                    <li><a href="#">关于点餐系统</a></li>
                                    <li><a href="#"></a></li>
                                    <li><a href="#"></a></li>
                                    <li role="separator" class="divider"></li>
                                    <li><a href="xiugai.php">修改登录信息</a></li>                                
                                    <li><a href="tuichu.php" >退出登录</a></li>												  
                                </ul>
                            </li>
                        </ul>

                    </div>
                </div>

            </nav>
   <!--修改表-->
	<div class="row">
	<div class="col-sm-offset-1 col-sm-2">
	<a href="cailiebiao.php" type="submit" class="btn btn-default btn-block">菜品列表
	</a>
	<a href="zhuohao.php" type="submit" class="btn btn-default btn-block">返回首页
	</a>
    </div>



<div class="col-sm-4">
	  <div class="panel panel-primary" style="width: 300px;">
            <div class="panel-heading">
                <h1 class="panel-title">
                    <span class="glyphicon glyphicon-plus"></span>
                                                            添加菜品
                </h1>
            </div>
            <div class="panel-body">
                                <form action="addcp.php" method="post" class="form-horizontal" enctype="multipart/form-data">
                    <div class="form-group">
                        <label class="control-label col-sm-3 hidden-xs">菜名：</label>
                        <div class="col-sm-9">
                            <input required="required" name="name" value="" class="form-control" placeholder="菜名">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3 hidden-xs">单价：</label>
                        <div class="col-sm-9">
                            <input required="required" name="jiage" value="" type="number" min="1" class="form-control" placeholder="单价">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3 hidden-xs">类型：</label>
                        <div class="col-sm-9">
        				    <select required="required" action="addcp.php" class="form-control" name="caixiid" >
        				        <option >请选择</option>
        				           
        				         
        				            
        				           <?php
			for($g=0;$g<count($arrl);$g++){
                 $y=$arrl[$g];
				?>

<option value="<?php echo $y["id"]?>">   
                     
				<?php echo $y["caixiname"] ;?>

             	</option>

   <?php
			 }                  
                	?>	
        				                				    </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-3 hidden-xs">图片：</label>
                        <div class="col-sm-9">
                            <input required="required" type="file" name="file" class="form-control">
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-offset-3 col-sm-4">
                            <button class="btn btn-primary btn-block" >添加</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>

</div>
</div>

		<footer>
		  <hr/>
		  <p class="text-right"><small>点餐系统Demo@喻德软件快训</small></p>
		</footer>




</body>
<html>
